const actions = {
  async getPic({ commit }) {
    const res = await fetch("http://118.31.35.160:4000/mine/gift", {
      headers: new Headers({
        Authorization: `Bearer ${localStorage.getItem("token")}`
      })
    });
    const result = await res.json();
    commit("get", { res: result });
    // commit
    // .then(response => {
    //   return response.json();
    // })
    // .then(res => {
    //   // console.log("res", res);
    //   commit("get", {
    //     res: res.result
    //   });
    // });
  }
};

export default actions;
